package observer_pattern;

/**
 * @author: 叶子
 * @date: 2022/06/30 23:08
 * 第四步：使用Subject和实体观察者对象
 **/
public class ObserverPatternDemo {
    public static void main(String[] args) {
        Subject subject = new Subject();
        new HexObserver(subject);
        new OctalObserver(subject);
        new BinaryObserver(subject);
        System.out.println("Fist state change:15");
        subject.setState(15);
        System.out.println("Second state change:10");
        subject.setState(10);
    }
}